dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlHelper Class / ExecuteScalar Method / ExecuteScalar(MySqlConnection,String,MySqlParameter[]) Method
The MySqlConnection object to use.
Command text to use for the command.
Parameters to use for the command.

ExecuteScalar(MySqlConnection,String,MySqlParameter[]) Method
Execute a single command against a MySQL database and returns a single value as the result.
Syntax
'Declaration
 
Public Overloads Shared Function ExecuteScalar( _
   ByVal connection As MySqlConnection, _
   ByVal commandText As String, _
   ByVal ParamArray commandParameters() As MySqlParameter _
) As Object
 

Parameters

connection
The MySqlConnection object to use.
commandText
Command text to use for the command.
commandParameters
Parameters to use for the command.

Return Value

The first column of the first row in the result set, or a null reference if the result set is empty.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also